package com.container.app;

import com.container.app.utilities.Pair;

/**
 * Created with IntelliJ IDEA.
 * User: Georgiana.Scarlat
 * Date: 7/12/12
 * Time: 10:54 AM
 */
public abstract class MContainerConfiguration {

    private MContainer container;

    public MContainerConfiguration(MContainer container) {
        this.container = container;
        configure();
    }

    /**
     * Configures the associations needed to inject instances.
     * <p/>
     * It must be a sequence of addMapping calls.  (se testclasses.configurations packet)
     */
    public abstract void configure();

    protected final void addMapping(Class interf, Pair<Class, String> annotation, Object implementation_instance) {

        container.addMappingToCache(new Pair<Pair<Class, Pair<Class, String>>, Object>(new Pair<Class, Pair<Class, String>>(interf, annotation), implementation_instance));

    }


}
